package com.cfl.ticketmodule;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import com.cfl.ticketmodule.service.CityService;
import com.cfl.ticketmodule.service.TicketNumberService;
import com.cfl.ticketmodule.service.TicketService;
import com.cfl.ticketmodule.service.impl.CityServiceImpl;
import com.cfl.ticketmodule.service.impl.TicketNumberServiceImpl;
import com.cfl.ticketmodule.service.impl.TicketServiceImpl;

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
@EnableEurekaClient
@ComponentScan(basePackages = "com.cfl.ticketmodule")
public class TicketModuleApplication {

	@Bean
	public TicketService ticketService() {
		return new TicketServiceImpl();
	}
	
	@Bean
	public TicketNumberService ticketNumberService() {
		return new TicketNumberServiceImpl();
	}
	
	public CityService cityService() {
		return new CityServiceImpl();
	}
	
	public static void main(String[] args) throws Exception {
		SpringApplication.run(TicketModuleApplication.class, args);
	}
}
